package com.dzu.easy;

/**
 * @author ZhaoDong
 * @date 2022/10/11 9:32
 * @description 551. 学生出勤记录 I
 */
public class Test551 {
    public static void main(String[] args) {
        System.out.println(checkRecord("LLL"));
    }


    public static boolean checkRecord(String s) {


        int count = 0;
        int start = 0;
        for (int end = 0; end < s.length(); end++) {
            char str = s.charAt(end);
            if (str == 'A') {
                count++;
                if (count > 1) {
                    return false;
                }
            }
            if (str == 'L') {
                start++;
            } else {
                start = 0;
            }
            if (start > 2) {
                return false;
            }
        }
        return true;

    }
}
